package JAVA;

public class work3104 {
    public static void main(String[] args) {
        int[] a = {1, 3, 4, 5, 0, 0, 6, 6, 0, 5, 4,7,6,7,0,5};
        int num = 0;
        for (int i = 0; i < a.length; i++) {
            int k = i;
            for (int j = i + 1; j < a.length; j++) {
                if (a[k] > a[j]) {
                    k = j;
                }
            }
            if (k != i) {
                int temp = a[i];
                a[i] = a[k];
                a[k] = temp;
            }
            if (a[i] == 0) {
                num++;
            }
        }
        int[] b = new int[a.length - num];
        for (int i = 0; i < b.length; i++) {
            b[i] = a[num];
            num++;
            System.out.print(b[i] + " ");
        }
    }
}